branch-4.0: [Feature](iceberg) Add manifest-level cache for Iceberg tables to reduce I/O and parsing overhead #59056#59408
Merged
yiguolei merged 1 commit intobranch-4.0from Jan 7, 2026
Conversation
…uce I/O and parsing overhead (#59056) ### What problem does this PR solve? ## Motivation During Iceberg query planning, FE needs to read and parse the metadata chain: ManifestList → Manifest → DataFile/DeleteFile. When frequently querying hot partitions or executing small batch queries, the same Manifest files are repeatedly read and parsed, causing significant I/O and CPU overhead. ## Solution This PR introduces a manifest-level cache (`IcebergManifestCache`) in FE to cache the parsed DataFile/DeleteFile lists per manifest file. The cache is implemented using Caffeine with weight-based LRU eviction and TTL support. ### Key Components - **IcebergManifestCache**: Core cache implementation using Caffeine - Weight-based LRU eviction controlled by `iceberg.manifest.cache.capacity-mb` - TTL expiration via `iceberg.manifest.cache.ttl-second` - Single-flight loading to prevent duplicate parsing of the same manifest - **ManifestCacheKey**: Cache key consisting of: - Manifest file path - **ManifestCacheValue**: Cached payload containing: - List of `DataFile` or `DeleteFile` - Estimated memory weight for eviction - **IcebergManifestCacheLoader**: Helper class to load and populate the cache using `ManifestFiles.read()` ### Cache Invalidation Strategy - Key changes automatically invalidate stale entries (length/lastModified/sequenceNumber changes) - TTL prevents stale data when underlying storage doesn't support precise mtime/etag - Different snapshots use different manifest paths/keys, ensuring snapshot-level isolation ### Iceberg Catalog Properties | Config | Default | Description | |--------|---------|-------------| | `iceberg.manifest.cache.enable` | `true` | Enable/disable manifest cache | | `iceberg.manifest.cache.capacity-mb` | `1024` | Maximum cache capacity in MB | | `iceberg.manifest.cache.ttl-second` | `48 * 60 * 60` | Cache entry expiration after access | ### Integration Point The cache is integrated in `IcebergScanNode.planFileScanTaskWithManifestCache()`, which: 1. Loads delete manifests via cache and builds `DeleteFileIndex` 2. Loads data manifests via cache and creates `FileScanTask` for each data file 3. Falls back to original scan if cache loading fails
Contributor
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
yiguolei
approved these changes
Jan 7, 2026
Contributor
Author
|
PR approved by at least one committer and no changes requested. |
Contributor
Author
|
PR approved by anyone and no changes requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #59056